package com.itransition.starnetwork;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;

/**
 * Created by IntelliJ IDEA.
 * User: Игорь
 * Date: 16.10.11
 * Time: 18:47
 * To change this template use File | Settings | File Templates.
 */
public class HibernateUtil {
    private static final SessionFactory sessionFactory;
    static {
        try {
            sessionFactory = new Configuration().configure().buildSessionFactory();
        }
        catch ( Throwable exception ) {
            System.err.println("Initial SessionFactory creation failed" + exception);
            throw  new ExceptionInInitializerError(exception);
        }
    }
    
    public static SessionFactory getSessionFactory() {
        return sessionFactory;
    }
}
